package com.ruoyi.ftrl.service.impl;

import com.ruoyi.ftrl.domain.CommunityMapping;
import com.ruoyi.ftrl.mapper.CommunityMappingMapper;
import org.springframework.beans.factory.annotation.Autowired;  
import org.springframework.stereotype.Service;  

import java.util.HashMap;  
import java.util.List;  
import java.util.Map;  

@Service  
public class CommunityMappingService {  

    @Autowired  
    private CommunityMappingMapper communityMappingMapper;  

    public Map<String, String> getCommunityMap() {  
        List<CommunityMapping> mappings = communityMappingMapper.selectAllMappings();  
        Map<String, String> communityMap = new HashMap<>();  
        for (CommunityMapping mapping : mappings) {  
            communityMap.put(mapping.getIds(), mapping.getName());
        }  
        return communityMap;  
    }  
}